package cn.gengar.types.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ActivityStatusEnumVO {
    CREATE(0, "创建"),
    EFFECTIVE(1, "生效"),
    OVERDUE(2, "过期"),
    ABANDONED(3, "废弃"),
    ;

    private Integer code;
    private String info;

    public static ActivityStatusEnumVO of(Integer code) {
        for (ActivityStatusEnumVO activityStatusEnumVO : ActivityStatusEnumVO.values()) {
            if (activityStatusEnumVO.getCode().equals(code)) {
                return activityStatusEnumVO;
            }
        }
        return null;
    }
}
